using System;
using System.Drawing;
using System.Globalization;
using System.Reflection;
using System.Runtime.Serialization;

namespace CartoGraphic.Model2
{
	public class Layer1
	{
		private string _name;
		private bool _isDirty;
		private bool _visible;
		private bool _active;
		private GraphicsList _graphicsList;
        private GraphicsProperties gp;
        int depth;

        public GraphicsProperties GP
        {
            get { return gp; }
            set { gp = value; }
        }

        public int Depth
        {
            get { return depth; }
            set { depth = value; }
        }

		public string LayerName
		{
			get { return _name; }
			set { _name = value; }
		}

		public GraphicsList Graphics
		{
			get { return _graphicsList; }
			set { _graphicsList = value; }
		}

		public bool IsVisible
		{
			get { return _visible; }
			set { _visible = value; }
		}

		public bool IsActive
		{
			get { return _active; }
			set { _active = value; }
		}

		public bool Dirty
		{
			get
			{
				if (_isDirty == false)
					_isDirty = _graphicsList.Dirty;
				return _isDirty;
			}
			set
			{
				_graphicsList.Dirty = false;
				_isDirty = false;
			}
		}

		private const string entryLayerName = "LayerName";
		private const string entryLayerVisible = "LayerVisible";
		private const string entryLayerActive = "LayerActive";
		private const string entryObjectType = "ObjectType";
		private const string entryGraphicsCount = "GraphicsCount";

		public void SaveToStream(SerializationInfo info, int orderNumber)
		{
			
		}

		public void LoadFromStream(SerializationInfo info, int orderNumber)
		{
			
		}


		internal void Draw(Graphics g)
		{
			_graphicsList.Draw(g,GP);
		}
	}
}